package com.hexanet.server.dao;

import org.hibernate.Query;
import org.hibernate.Session;

import com.hexanet.bom.Role;

public class RoleDao extends DataAccessDao<Role> {

    public void removeRoleForPrincipal(String mail) {

	Session session = getSession();
	session.getTransaction().begin();

	Query deleteQuery = session
		.createSQLQuery("Delete from roles where mail = ?");
	deleteQuery.setString(0, mail);
	deleteQuery.executeUpdate();

	session.getTransaction().commit();

    }

}
